<?php

namespace app\model;

use think\Model;

/**
 * 供求模型
 * @package app\model
 */
class Supply extends Model
{
    // 自动写入时间戳
    protected $autoWriteTimestamp = true;

    //create_time读取器
    protected function getCreateTimeAttr($value)
    {
        return date('Y-m-d', $value);
    }

    //update_time读取器
    protected function getUpdateTimeAttr($value)
    {
        return date('Y-m-d H:i:s', $value);
    }

    public function attachment()
    {
        return $this->belongsTo('Attachment', 'id', 'pictures')->bind('path');
    }

}
